From: Kenichi Handa Date: Wed, 29 Apr 2009 01:40:57 +0000 (+0000) Subject: (x_set_font): When ARG is a font-object, check if the X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~717 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9d25121ec6d35e46dafe717f8f9d71df9af95c9d;p=emacs.git (x_set_font): When ARG is a font-object, check if the font-object matches with the ASCII font-spec of the frame's fontset. If not, create a new fontset for the frame. --- diff --git a/src/frame.c b/src/frame.c index 80a691e35fd..eb9088b5478 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3418,6 +3418,16 @@ x_set_font (f, arg, oldval) itself in the future. */ arg = AREF (font_object, FONT_NAME_INDEX); fontset = FRAME_FONTSET (f); + /* Check if we can use the current fontset. If not, set FONTSET + to -1 to generate a new fontset from FONT-OBJECT. */ + if (fontset >= 0) + { + Lisp_Object ascii_font = fontset_ascii (fontset); + Lisp_Object spec = font_spec_from_name (ascii_font); + + if (! font_match_p (spec, font_object)) + fontset = -1; + } } else signal_error ("Invalid font", arg);